// 主题变化状态设置

import 'package:flutter/material.dart';

class ThemeProvider with ChangeNotifier {
  bool _isDarkMode = false;

  bool get isDarkMode => _isDarkMode;

  // 返回当前的主题（亮色或暗色）
  ThemeData get theme => _isDarkMode ? ThemeData.dark() : ThemeData.light();

  // 切换主题
  void toggleTheme() {
    _isDarkMode = !_isDarkMode;
    // 通知所有监听者更新
    notifyListeners();
  }
}